package messages;

import java.io.Serializable;


/**
 * This is our Message system we use to send messages between the client to the server.
 * all messages inherits from this class. every message has a unique purpose and it gets it 
 * type from the enum to the server or the client can identify what the message meaning is.
 * @author Jacob
 * @author Amir
 *
 */
public class Message implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private MessageType messageType;

	public enum MessageType {
	    MESSAGE_LOGIN,
	    MESSAGE_LOGIN_REPLY,
	    MESSAGE_LOGOUT,
	    MESSAGE_LOGOUT_REPLY,
	    MESSAGE_GET_TEACHER_SUBJECT,
	    MESSAGE_EXECUTE_EXAM_CHECK_CODE,
	    MESSAGE_EXECUTE_EXAM_CHECK_CODE_REPLY,
	    MESSAGE_TEACHER_SUB_REPLY,
	    MESSAGE_GET_SUBJECT,
	    MESSAGE_SUBJECT_REPLY,
	    MESSAGE_LOG_EVERYONE_OUT,
	    MESSAGE_GET_TEACHER,
	    MESSAGE_TEACHER_REPLY, 
	    MESSAGE_MANAGE_QUESTION,
	    MESSAGE_GET_STUDENT,
	    MESSAGE_EXECUTE_EXAM_GET_EXAM,
	    MESSAGE_EXECUTE_EXAM_GET_EXAM_REPLY,
	    MESSAGE_STUDENT_IN_TEST,
	    MESSAGE_QUESTIONS_BY_SUBJECT,
	    MESSAGE_GET_QUESTION_LIST_BY_TESTID,
	    MESSAGE_QUESTIONS_BY_SUBJECT_REPLY,
	    MESSAGE_EXTRA_TIME_CHECK,
	    MESSAGE_GET_COURSE_IN_SUBJECT,
	    MESSAGE_START_TIME,
	    MESSAGE_EXTRA_TIME_CHECK_REPLY,
	    MESSAGE_SUMBIT_TEST_CHOICES,
	    MESSAGE_AUTOMATIC_CLOSER,
	    MESSAGE_GET_ALL_QUESTIONS,
	    MESSAGE_GET_ALL_QUESTIONS_REPLY,
	    MESSAGE_GET_ALL_EXAMS,
	    MESSAGE_STUDENTS_BY_EXECUTETESTID,
	    MESSAGE_STUDENTS_BY_EXECUTETESTID_REPLY,
	    MESSAGE_APPROVED_TEST,
	    MESSAGE_APPROVED_TEST_REPLY,
	    MESSAGE_GET_ALL_EXECUTE_EXAMS,
	    MESSAGE_FINAL_GRADE,
	    MESSAGE_GET_QUESTION_LIST_BY_TEACHERID,
	    MESSAGE_QUESTION_UPDATE, 
	    MESSAGE_ALLOCATE_TEST_ID,
	    MESSAGE_GET_STUDENT_GRADE,
	    MESSAGE_GET_STUDENT_GRADE_REPLY,
	    MESSAGE_SAVE_QUESTION_TEST,
	    MESSAGE_APPROVED_TEST_BY_EXECUTE_TEST,
	    MESSAGE_APPROVED_TEST_BY_EXECUTE_TEST_REPLY,
	    MESSAGE_TEST_LOCK,
	    MESSAGE_TEST_LOCK_REPLY,
	    MESSAGE_GET_TEACHER_COURSE_SEMESTER,
	    MESSAGE_TEACHER_EXAM,
	    MESSAGE_TEACHER_EXAM_REPLY,
	    MESSAGE_GET_EXECUTED_EXAM_LIST_BY_TEACHERID,
	    MESSAGE_GET_EXECUTED_EXAM_LIST_REPLY,
	    MESSAGE_GET_EXAM_BY_COURSEID, 
	    MESSAGE_EXECUTE_EXAMS_BY_COURSEID,
	    MESSAGE_CHEATERS_CHECK,
	    MESSAGE_CHEATERS_CHECK_REPLY, 
	    MESSAGE_STUDENT_IN_COURSE,
	    MESSAGE_ALLOCATE_EXECUTE_TEST,
	    MESSAGE_GET_NEW_TEACHER_REQUESTS,
	    MESSAGE_REQUEST_TIME_EXTENTION,
	    MESSAGE_REQUEST_DECISION,
	    MESSAGE_ALLOCATE_EXECUTE_INFO,
	    MESSAGE_STATISTICS_LIST_BY_EXECUTED_TEST_LIST,
	    MESSAGE_GET_ALL_STUDENTS,
	    MESSAGE_GET_EXECUTED_EXAM_LIST_BY_STUDENTID,
	    MESSAGE_GET_ALL_COURSES,
	    MESSAGE_GET_EXECUTED_EXAM_LIST_BY_COURSEID,
	    MESSAGE_GET_WORD_FILE,
	    MESSAGE_GET_EXECUTED_EXAM_LIST_BY_AUTHORID, 
	    MESSAGE_ALLOCATE_MANUAL_TEST,
	    MESSAGE_SEND_WORD_FILE,
	    MESSAGE_GET_STUDENT_WORD_FILE,
	    MESSAGE_FINAL_GRADE_MANUAL, 
	    MESSAGE_GET_PATH_MANUAL_EXAM
	
   
	    
	}
	
	/**
	 * 
	 * @param type Message type
	 */
	public Message(MessageType type){
		messageType = type;	
	}

	
	/**
	 * 
	 * @return Message type
	 */
	public MessageType getMessageType(){
		return messageType;	
	}
	
	/**
	 * 
	 * @param messageType
	 */
	public void setMessageType(MessageType messageType){
		this.messageType = messageType;
		
	}
	

	
	
	
}

